package com.startasone.mapper;


import com.startasone.pojo.Dept;
import com.startasone.pojo.Result;
import com.startasone.service.DeptService;
import com.startasone.service.Impl.DeptServiceImpl;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Update("update tlias.dept set name =#{name} where id=#{id}")
    public void update(Dept dept);

    @Select("select * from tlias.dept")
    public List<Dept> list();

    @Delete("delete from dept where id =#{id}")
    public void delete(Integer id);

    @Insert("insert into dept(name, create_time, update_time) values (#{name},#{createTime},#{updateTime})")
    public void save(Dept dept);

    @Select("select * from tlias.dept where id=#{id}")
    public Dept getById(Integer id);
}
